var toTop=document.querySelector("#toTop");

window.onscroll=function(){
    if (document.documentElement.scrollTop>1000||document.body.scrollTop>1000){
        toTop.style.display='block';
    }else {
        toTop.style.display='none';
    }
};

toTop.addEventListener('click',function(){
//    滚到指定位置
//    window.scrollTo(0,0);
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
});



var dt_nav_btn=document.querySelector("#dt-nav-btn");
var dt_nav_content=document.querySelector("#dt-nav-content");

dt_nav_btn.addEventListener("mouseover",function(){
    dt_nav_content.style.display="block";
});
dt_nav_btn.addEventListener("mouseleave",function(){
    dt_nav_content.style.display="none";
});
dt_nav_content.addEventListener("mouseover",function(){
    dt_nav_content.style.display="block";
});
dt_nav_content.addEventListener("mouseleave",function(){
    dt_nav_content.style.display="none";
});



var num1=document.querySelector("#zan0").innerHTML;
var lang='zh';
function zan(){
    if(lang=='zh'){
        lang = 'en'
    }else {
        lang='zh'
    }
    num1=Number(num1);
    if(lang=='en'){
        document.querySelector("#zan0").innerHTML=num1+1;
    }else {
        document.querySelector("#zan0").innerHTML=num1;
    }
}

var num2=document.querySelector("#sc0").innerHTML;
function zan1(){
    if(lang=='zh'){
        lang = 'en'
    }else {
        lang='zh'
    }
    num2=Number(num2);
    if(lang=='en'){
        document.querySelector("#sc0").innerHTML=num2+1;
    }else {
        document.querySelector("#sc0").innerHTML=num2;
    }
}
